﻿using System;
using System.IO;
using Ioacp.Library.Helpers;

namespace Ioacp.Irisking
{
    /// <summary>
    /// 中科虹霸识别
    /// </summary>
    public class IrisIdentify : IDisposable
    {
        public void Init()
        {
            // 释放中科虹霸资源包
            if (!File.Exists("ACE-vc100-5.8.3.dll")) ResHelper.ExtractResFile("Ioacp.Irisking.Resources.ACE-vc100-5.8.3.dll", "ACE-vc100-5.8.3.dll");
            if (!File.Exists("ik_common-vc100-md-2.4.57.dll")) ResHelper.ExtractResFile("Ioacp.Irisking.Resources.ik_common-vc100-md-2.4.57.dll", "ik_common-vc100-md-2.4.57.dll");
            if (!File.Exists("IKAuxilian-vc100-3.4.45.dll")) ResHelper.ExtractResFile("Ioacp.Irisking.Resources.IKAuxilian-vc100-3.4.45.dll", "IKAuxilian-vc100-3.4.45.dll");
            if (!File.Exists("IKEnroll-vc100-3.4.45.dll")) ResHelper.ExtractResFile("Ioacp.Irisking.Resources.IKEnroll-vc100-3.4.45.dll", "IKEnroll-vc100-3.4.45.dll");
            if (!File.Exists("IKIdentify-vc100-3.4.45.dll")) ResHelper.ExtractResFile("Ioacp.Irisking.Resources.IKIdentify-vc100-3.4.45.dll", "IKIdentify-vc100-3.4.45.dll");
            if (!File.Exists("Ty.Client.dll")) ResHelper.ExtractResFile("Ioacp.Irisking.Resources.Ty.Client.dll", "Ty.Client.dll");
        }

        #region IDisposable Members

        private bool _disposed = false;

        /// <summary>
        /// 
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="disposing"></param>
        protected void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _disposed = true;
            }
        }

        #endregion
    }
}